#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


//void Widget::on_pushButton_clicked()
//{
//    qDebug()<<"九龙天罡剑";
//}

//void Widget::on_pushButton_2_clicked()
//{
//    bool enab = ui->pushButton->isEnabled();
//    if(enab)
//    {
//        ui->pushButton->setEnabled(false);
//    }
//    else
//    {
//        ui->pushButton->setEnabled(true);
//    }
//}

void Widget::on_pushButton_up_clicked()
{
    QRect ret = ui->pushButton->geometry();
    ret.setX(ret.y()-10);
    ui->pushButton->setGeometry(ret);
//    ui->pushButton->setGeometry(ret.x(),ret.y()-10,ret.width(),ret.height());

}

void Widget::on_pushButton_left_clicked()
{
    QRect ret = ui->pushButton->geometry();
    ui->pushButton->setGeometry(ret.x()-10,ret.y(),ret.width(),ret.height());
//    ret.setX(ret.x()-10);
//    ui->pushButton->setGeometry(ret);
}

void Widget::on_pushButton_right_clicked()
{
    QRect ret = ui->pushButton->geometry();
    ui->pushButton->setGeometry(ret.x()+10,ret.y(),ret.width(),ret.height());
//    ret.setX(ret.x()+10);
//    ui->pushButton->setGeometry(ret);
}

void Widget::on_pushButton_down_clicked()
{
    QRect ret = ui->pushButton->geometry();
    ui->pushButton->setGeometry(ret.x(),ret.y()+10,ret.width(),ret.height());
//    ret.setX(ret.y()+10);
//    ui->pushButton->setGeometry(ret);
}
